//
//  SingletonClass.swift
//  Swift各种传值
//
//  Created by Bao on 15/12/10.
//  Copyright © 2015年 Microlink. All rights reserved.
//

import UIKit

class SingletonClass: NSObject {
    var str:String?
    
    class func shareInstance() -> SingletonClass{
        struct Once{
            static var token:dispatch_once_t = 0
            static var signleton:SingletonClass! = nil
        }
        dispatch_once(&Once.token, {
            Once.signleton = SingletonClass()
        })
        return Once.signleton
    }

}

